package com.example.rxjavamodule.login;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;

import com.example.rxjavamodule.R;
import com.example.rxjavamodule.login.Bean.SuccessData;
import com.example.rxjavamodule.login.core.CustomObserver;
import com.example.rxjavamodule.login.core.LoginEngine;

public class LoginActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        LoginEngine.login("Clark", "123456")
                .subscribe(new CustomObserver() {
                    @Override
                    public void success(SuccessData data) {
                        Log.d("Derry", "成功Bean详情：successBean:" + data.toString());
                    }

                    @Override
                    public void error(String message) {
                        Log.d("Derry", "失败:" + message);
                    }
                });
    }
}